#include "iostream"
using namespace std;


struct Teacher
{
	char name[64];
	int age;
};

//指针的引用而已
int initTeacher(Teacher* &p)
{
	Teacher *tmp;
	tmp = (Teacher *)malloc(sizeof(Teacher));
	if(tmp == NULL)
	{
		goto END;
	}

	tmp->age = 34;

	p = tmp;

	return 0;
END:
	return -1;
}


int main()
{
	Teacher *p = NULL;

	int ret = initTeacher(p);

	if(ret == -1)
	{
		cout << "initTeacher() error" << endl;
		return -1;
	}

	cout << "age:" << p->age << endl;

	return 0;
}